package com.example.hetong_system.model;

import java.io.Serializable;

public class ResponseResult implements Serializable {
    private boolean success;
    private String message;
    private Object data;

    public static ResponseResult success(String message) {
        return success(message, null);
    }

    public static ResponseResult success(String message, Object data) {
        ResponseResult result = new ResponseResult();
        result.setSuccess(true);
        result.setMessage(message);
        result.setData(data);
        return result;
    }

    public static ResponseResult error(String message) {
        return error(message, null);
    }

    public static ResponseResult error(String message, Object data) {
        ResponseResult result = new ResponseResult();
        result.setSuccess(false);
        result.setMessage(message);
        result.setData(data);
        return result;
    }

    // getter和setter方法
    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}